package com.threeonemeeting.listcache;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.threeonemeeting.R;

public class MessageInfoCache {

	private View baseView;

	private int nMessageId;
	private String strSenderName;
	private String strSenderTime;
	private String strSenderMsg;

	private ImageView sendHeaderImageView;
	private TextView senderNameTextView;
	private TextView senderTimeTextView;
	private TextView senderMsgTextView;

	public MessageInfoCache(View baseView, int nMessageId,
			String strSenderName, String strSenderTime, String strSenderMsg) {
		this.baseView = baseView;
		this.nMessageId = nMessageId;
		this.strSenderName = strSenderName;
		this.strSenderTime = strSenderTime;
		this.strSenderMsg = strSenderMsg;
	}

	public int getMessageId() {
		return this.nMessageId;
	}

	public String getSenderName() {
		return this.strSenderName;
	}

	public String getSenderTime() {
		return this.strSenderTime;
	}

	public String getSenderMsg() {
		return this.strSenderMsg;
	}

	public ImageView getSenderHeaderImagetView() {
		if (sendHeaderImageView == null) {
			sendHeaderImageView = (ImageView) baseView
					.findViewById(R.id.user_image);
		}
		return sendHeaderImageView;
	}

	public TextView getSenderNameTextView() {
		if (senderNameTextView == null) {
			senderNameTextView = (TextView) baseView
					.findViewById(R.id.sender_name);
		}
		return senderNameTextView;
	}

	public TextView getSenderTimeTextView() {
		if (senderTimeTextView == null) {
			senderTimeTextView = (TextView) baseView
					.findViewById(R.id.sender_time);
		}
		return senderTimeTextView;
	}

	public TextView getSenderMsgTextView() {
		if (senderMsgTextView == null) {
			senderMsgTextView = (TextView) baseView
					.findViewById(R.id.sender_msg);
		}
		return senderMsgTextView;
	}
}
